<%-- 
    Document   : index
    Created on : Feb 27, 2011, 10:31:30 AM
    Author     : RaheelArif
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
 var q= new Array(260);
 var count=0;
 function del(a)
 {
    // alert(q[a]);
     //alert(a);
     var b=a;
     if(b==count || b>count)
         {
           return;
         }
     if(b<count)
     {
     //    alert("b<count");
             q[b]=q[b+1];
             b++;
             del(b);
             return;
     }
 }
  function  changeImg(var1)
  {
      
     
    var booked= "<img src= current.jpg  height=\"30px\" width=\"25px\"  onclick=\"changeImg("+var1+")\"/>";
    var available="<img src= free.jpg  height=\"30px\" width=\"25px\" onclick=\"changeImg("+var1+")\"/>";


      var b = document.getElementById(var1).innerHTML;

    if(b.indexOf("free.jpg")==-1)
        {
         document.getElementById(var1).innerHTML=available;
         var i=0;
         while(i<count)
             {
                 if(q[i]==var1)
                     {

                         del(i);
                         count--;
                     }
                     
                 i++;
             }
             str="<p>";
          var i=0;
          while(i<count)
              {
                 str=str+" "+q[i];
                 i++;
              }
              str=str+"</p>";
              document.getElementById("abc").innerHTML=str;
        }
  else
      {
          
        document.getElementById(var1).innerHTML=booked;
          q[count]=var1;
          count++;
           
          str="<p>";
          var i=0;
          while(i<count)
              {
                 str=str+" "+q[i];
                 i++;
              }
              str=str+"</p>";
              document.getElementById("abc").innerHTML=str;

      }
      
  }

</script>
</head>
<body>

<div id="header">
    <ul>
        <li style="display:inline;"><a style="text-align:right;text-decoration:none;color:white;position: relative;left:800px;" href="login.html">LOGIN</a></li>
    </ul>
</div>
<div id="head">
	<div id="menu">
		<ul>
			<li><a href="index.html" id="current" style="color:#D2B48C;">HOME</a></li>
			<li><a href="current.html" >CURRENT MOVIES</a></li>
			<li><a href="signUp.html">SIGN UP</a></li>
			<li><a href="ContactUs.html">CONTACT US</a></li>
		</ul>
	</div>
</div>


<div id ="mainbody">
<div id="main">
<h2 class="hh">Theater Seating Plan</h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="stage.jpg" width="600px" height="100px" style="text-align:center" /><br /><br /><br />
<form>
<%
int i=1;
int temp = 0;
char a='A';
char s='B';
int count=1;
int id_checkbox=260;
int id_img=0;
int j=1;

    %>
    &nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10
    <br />
    <%
    
    
%>
<br />

<%
while(i<=13)
  {
    %>
    <%= a %>
    <%
    a++;
  while(j<=10)
  {
      if(i==1)
          {
      %>
      <div id="<%= id_img %>" style="display:inline;"><img src= booked.jpg  height="30px" width="25px"/></div>
      <%
      }
      else
          {
          %>
  <div id="<%= id_img %>" style="display:inline;"><img src= free.jpg  height="30px" width="25px" onclick="changeImg('<%= id_img %>')"/></div>
<%
}

        id_img++;
	j++;
  }
  %>
  &nbsp; &nbsp; &nbsp; &nbsp;
  <%
   j=1;
   %>
<%= a %>
<%
a++;
     while(j<=10)
    {

         if(i==1)
             {
      %>
   <div id="<%= id_img %>"  style="display:inline;"><img src= booked.jpg  height="30px" width="25px"/></div>
   <%
   }
   else
       {
         %>
      <div id="<%= id_img %>"  style="display:inline;"><img src= free.jpg  height="30px" width="25px" onclick="changeImg('<%= id_img %>')"/></div>
    <%
            }
            id_img++;
            j++;
           
    }
  %>
  <br />
  <%
  j=1;
  %>
  <table>
   
  
  

  
  <%
   j=1;

     while(j<=10)
    {
         temp= id_checkbox -260;
         if(i==1)
         {
      %>

      <%
      }
      else
       {
             %>

    <%
    }
            id_checkbox++;
            j++;
    }
   
%>
  </table>
    <br /> 
<%
   j=1;

   i++;
  }

%>
<br/>
</form>
<table cellspacing="10">
    <tr>
        <td>
<form id="2" action ="reserve.jsp" method="POST">
    &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="reserve" value="Reserve" style="background-color:black;color:#ffffff; border:none;cursor:pointer;cursor:hand;" />
</form>
        </td>
        <td>
    <form id="3" action ="purchase.jsp" method="POST">
 <input type="submit" name="Login" value="Purchase" style="background-color:black;color:#ffffff; border:none;cursor:pointer;cursor:hand;" />     
    </form>
            </td>
    </tr>
</table>
</div>
<div id="sidebar">
<h2  class="hh">Navigation</h2>
<table  width="200px">
    <tr><td class="neww"><a href="#"><span>Add Movie</span></a></td></tr>
    <tr><td class="neww"><a href="#"><span>Add Show</span></a></td></tr>
    <tr><td class="neww"><a href="#"><span>Remove Movie</span></a></td></tr>
    <tr><td class="neww"><a href="#"><span>Remove Show</span></a></td></tr>
    <tr><td class="neww"><a href="#"><span>Update Movie</span></a></td></tr>
    <tr><td class="neww"><a href="#"><span>Update Show</span></a></td></tr>
</table>
</div>
<div style="clear:right;" />
</div>
<!--
<div id="footer">
<img src="CSS/Images/foot.jpg" />
</div>
-->
<h2 class="hh">SELECTED SEATS:</h2>
<div id="abc">
    
</div>
<br/><br/><br/><br/>
</body>

</html>
